/**
 * ResetBehaviorDecorator class definition
 * Decorator that resets to "Started" the task it is applied to, each time said
 * task finishes.
 * 
 * Original credit for a java implementation to: http://magicscrollsofcode.blogspot.com/2010/12/behavior-trees-by-example-ai-in-android.html
 */

#ifndef RESETBEHAVIORDECORATOR_H_
#define RESETBEHAVIORDEOCRATOR_H_

#include "BehaviorDecorator.h"


class ResetBehaviorDecorator : public BehaviorDecorator 
{
public:
	/**
	 * Creates a new instance of the ResetDecorator class
	 * @param incBehavior BaseBehavior* to decorate
	 */
	ResetBehaviorDecorator(BaseBehavior* incBehavior, bool incRepeat = false) : BehaviorDecorator(incBehavior), repeat(incRepeat) {}


	/**
	 * Does the decorated task's action, and if it's done, resets it.
	 */
	void Execute();
private:
	bool repeat;

};

#endif
